<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/Admin/css/style.css" />
	<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/js/menu.js"></script>
	<style type="text/css">
		#addform{
			
			margin: 15px auto 10px auto;
		}
		table{
			width: 100%;
			text-align: center;
			margin-left: auto;
			margin-right: auto;
		}
		table th{
			background-color: #11B6B6;
			color: white;
			font-family: "微软雅黑";
		}
		#pageinfo{
			margin: 15px auto;
			text-align: center;
		}
		#updataform{
			width: 400px;
			background: white;
			height: 150px;
			border: solid 3px #DDDDDD;
			position: absolute;
			top: 25%;
			left: 25%;
			display: none;
			
		}
		#updataform p{
			margin-top: 40px;
			margin-left: 20px;
		}
		#spanX{
			position: absolute;
			top: 2px;
			right: 3px;
		}
	</style>
</head>
<body>
	<div class="right-nav">
          <ul>
              <li><img src="__PUBLIC__/Admin/images/home.png"></li>
                <li style="margin-left:25px;">您当前的位置：</li>
                <li><a href="__MODULE__/Index/index">分类设置</a></li>
                <li>></li>
                <li><a href="#">地区设置</a></li>
            </ul>
      </div>
	<div id="addform">
		<form action="__URL__/insert" method="post">
			<span>添加地区名:</span><input type="text" name="areaname"/>
			<input type="submit" value="添加" />
		</form>
	</div>
	
	<table id="tab" >
		<tr><th>地区ID</th><th>地区名称</th><th>信息数量</th><th>编辑</th><th>删除</th></tr>
		
		<foreach name="areas" item="area" >
		<tr>
			<td>{$area.id}</td>
			<td>{$area.area_name}</td>
			<td></td><td><a href="JavaScript:;" onclick="funAjax({$area.id},'{$area.area_name}');">编辑</a></td>
			<td><a href="__URL__/delete/id/{$area.id}">删除</a></td>
		</tr>
		</foreach>
	</table>
	<div id="updataform">
		<form action="__URL__/updata" method="post">
			<p><span>修改地区名:</span><input type="text" id="updatainput" name="areaname"/>
				<input type="hidden" id="areaid" name="areaid"value="" />
				<input type="submit" value="添加" />
			</p>
		<span id="spanX"><a href="JavaScript:;">×</a></span>
	</form>
	</div>
	<p id="pageinfo">{$pageinfo}</p>
	<script type="text/javascript">
		function funAjax(id,area_name){
			document.getElementById("updataform").style.display="block";
			document.getElementById("areaid").value=id;
			document.getElementById("updatainput").value=area_name;
		}
		var closewind=document.getElementById("spanX");
		closewind.onclick=function(){
			document.getElementById("updataform").style.display="none";
		}
	</script>
	
</body>
</html>